<?php
/**
 * Created by PhpStorm.
 * User: hp
 * Date: 2019/5/15
 * Time: 11:48
 */
header("Content-Type:application/json;charset=utf-8");
header("Access-Control-Allow-Origin:*");
include "dbhealper.php";
if($_SERVER["REQUEST_METHOD"]=="GET"){
    $arr=Array("msg"=>"不支持get请求方式","status"=>"0");
    print_r(json_encode($arr));
    return;
};
if(isset($_REQUEST["c_id"])){

    $sql="DELETE FROM `carts` WHERE c_id ='".$_REQUEST["c_id"]."'";

    $result=dbhealper($sql);
    if($result>=1){
        $arr=Array("msg"=>"删除成功","status"=>"1");
        print_r(json_encode($arr));
    }else{
        $arr=Array("msg"=>"删除失败","status"=>"-1");
        print_r(json_encode($arr));
    }
}else{
    $arr=Array("msg"=>"参数不完整,","status"=>"-12");
    print_r(json_encode($arr));
}


